package zhiziyibai.simpleweather;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 执子一白 on 2017/6/5.
 */

public class LeftOptionsChoose extends Fragment {

    private Button backButton;

    private ListView listView;

    private ArrayAdapter<String> adapter;

    private List<String> dataList=new ArrayList<>();

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        //return super.onCreateView(inflater, container, savedInstanceState);
        View view =inflater.inflate(R.layout.left_options,container,false);

        backButton= (Button) view.findViewById(R.id.options_back_button);
        listView= (ListView) view.findViewById(R.id.choose_option_list_view);

        backButton.setVisibility(View.GONE);
        listView= (ListView) view.findViewById(R.id.choose_option_list_view);
        adapter=new ArrayAdapter<>(getContext(),android.R.layout.simple_list_item_1);
        adapter.add("选择天气");
        listView.setAdapter(adapter);
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            }
        });

    }
}
